package cate.game.activity.bosstrain;

import cate.common.table.d.GDWarOrder;
import cate.game.activity.base.core.SubActivitySingle;
import cate.game.role.task.TaskGroup;

import java.util.List;

public class BossTrainTask extends SubActivitySingle<BossTrainActivity> {

    @Override
    public void onDaySpan(boolean silence) {
        super.onDaySpan(silence);
        List<Integer> taskIds = role.getGame().table.bossTrain.task.getTaskIds(parent.configTid(), GDWarOrder.TaskType.DAILY);
        TaskGroup taskGroup = role.getTask().getGroup(funcId());
        taskGroup.removeItemList(taskIds);
        taskGroup.addItemListNoRepeat(taskIds, silence);
    }

    public void excelCheck() {
        List<Integer> taskIds = role.getGame().table.bossTrain.task.getTaskIds(parent.configTid());
        role.getTask().getGroup(parent.funcId()).addItemListNoRepeat(taskIds, false);
    }

    public void onRoleOpen() {
    }

    public void onRoleEnd() {
        parent.getRole().getTask().removeGroup(funcId());
    }
}
